<?php
include('../config.php');
header("Access-Control-Allow-Origin:*");

$phone = $_POST['phone'];
$goods_id = $_POST['goods_id'];
$goods_count = $_POST['goods_count'];

$sql = "update shop_car set goods_count=$goods_count where phone='$phone' and goods_id=$goods_id ";
//       update shop_car set goods_count=4 where phone='15181158388' and goods_id=18;
//绝对字符串好像不行
// $res时一个资源类型
$res = mysql_query($sql);


if ($res) {
    echo json_encode(array(
      "code" => 200,
      "body" => array(
        "msg" => '商品更新成功'
      )
    ));
  } else {
    echo json_encode(array(
      "code" => 201,
      "body" => array(
        "msg" => '网络错误，请重试'
      )
    ));
  }






?>